package com.ruoyi.project.system.live.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.live.mapper.VideoLiveMapper;
import com.ruoyi.project.system.live.domain.VideoLive;
import com.ruoyi.project.system.live.service.IVideoLiveService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 视频直播Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-11
 */
@Service
public class VideoLiveServiceImpl implements IVideoLiveService 
{
    @Autowired
    private VideoLiveMapper videoLiveMapper;

    /**
     * 查询视频直播
     * 
     * @param videoId 视频直播主键
     * @return 视频直播
     */
    @Override
    public VideoLive selectVideoLiveByVideoId(Long videoId)
    {
        return videoLiveMapper.selectVideoLiveByVideoId(videoId);
    }

    /**
     * 查询视频直播列表
     * 
     * @param videoLive 视频直播
     * @return 视频直播
     */
    @Override
    public List<VideoLive> selectVideoLiveList(VideoLive videoLive)
    {
        return videoLiveMapper.selectVideoLiveList(videoLive);
    }

    /**
     * 新增视频直播
     * 
     * @param videoLive 视频直播
     * @return 结果
     */
    @Override
    public int insertVideoLive(VideoLive videoLive)
    {
        videoLive.setCreateTime(DateUtils.getNowDate());
        return videoLiveMapper.insertVideoLive(videoLive);
    }

    /**
     * 修改视频直播
     * 
     * @param videoLive 视频直播
     * @return 结果
     */
    @Override
    public int updateVideoLive(VideoLive videoLive)
    {
        videoLive.setUpdateTime(DateUtils.getNowDate());
        return videoLiveMapper.updateVideoLive(videoLive);
    }

    /**
     * 批量删除视频直播
     * 
     * @param videoIds 需要删除的视频直播主键
     * @return 结果
     */
    @Override
    public int deleteVideoLiveByVideoIds(String videoIds)
    {
        return videoLiveMapper.deleteVideoLiveByVideoIds(Convert.toStrArray(videoIds));
    }

    /**
     * 删除视频直播信息
     * 
     * @param videoId 视频直播主键
     * @return 结果
     */
    @Override
    public int deleteVideoLiveByVideoId(Long videoId)
    {
        return videoLiveMapper.deleteVideoLiveByVideoId(videoId);
    }
}
